<?php

namespace App\Inventor\Controllers;

use Encore\Admin\Grid;
use App\Services\PatentService;
use App\Repositories\PatentRepository;

class PatentLibraryController extends BaseController
{
    protected $title = '本校专利库';
    public $repository;
    public $patentService;

    public function __construct(PatentRepository $repository, PatentService $patentService)
    {
        $this->repository = $repository;
        $this->patentService = $patentService;
    }

    /**
     * Make a grid builder.
     *
     * @return Grid
     */
    protected function grid()
    {
        $grid = $this->repository->adminGrid('id');
        $grid = $this->patentService->gridColumn($grid);
        $grid->disableActions();
        $grid->disableCreateButton();
        return $grid;
    }
}
